#ifndef _MY_SETTING_H
#define _MY_SETTING_H

#include <Arduino.h>
#include <EEPROM.h>

#define WIFI_SSID "xxxx"
#define WIFI_PASS "xxxxxxxx"
#define WIFI_STA_NAME "ESP32"

#define MQTT_SERVER "xxx.xxx.xxx.xxx"
#define MQTT_PORT 1883
#define MQTT_USER "xxx"
#define MQTT_PASS "xxxxxx"
#define MQTT_PUBLISH_TOPIC "foaming/temperature" //不能用“.”,要用“/”;rabbit mq 程序里面要用"."

//////////////////////////////////////////////////
#define SENSER_QUANTITY 7 //传感器数量
#define SENSER_PIN                \
    {                             \
        5, 17, 16, 13, 14, 27, 26 \
    } //传感器PIN,MAX31865 CS(注意ESP32不是每个脚都能输出)//////////////////////
/////////////////////////////////////////////

#define CALIBRATE_POINT_MAX 10 //其它校准点(除0，100)，最多10个点，多出来就删除|t-tn|小于50的最早点
#define CALIBRATE_RANK 2       //拟合阶数

struct CalibratePoint
{
    uint16_t raw[CALIBRATE_POINT_MAX];
    double t[CALIBRATE_POINT_MAX];
    double parameter[CALIBRATE_RANK + 1]; //两阶，3个参数
};

class MySetting
{
private:
public:
    CalibratePoint calibratePoint[SENSER_QUANTITY];
    MySetting(void);
    ~MySetting();
    void writeAll();
    CalibratePoint *readAll();
};

#endif